package com.tsd.jxc.config;

import com.tsd.core.utils.HlpUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: JxcCodeRuleConstants
 * @Description: TODO
 * @Author: Hillpool
 * @Date: 2024/4/26 12:15
 * @Version: 1.0
 */
public class JxcCodeRuleConstants {
    /**
     * 编码规则中的参数名
     * 客户sid
     * 供应商sid
     * 部门sid
     */
    public static final String RULE_ITEM_PARAM_NAME_CLIENT_SID = "client_sid";
    public static final String RULE_ITEM_PARAM_NAME_SUPPLIER_SID = "supplier_sid";
    public static final String RULE_ITEM_PARAM_NAME_GROUP_SID = "group_sid";

    /**
     * 进销存-销售报价
     */
    public static final String TYPE_JXC_SALE_QUOTATION = "jxc_sale_quotation";
    public static final String TYPE_NAME_JXC_SALE_QUOTATION = "进销存-销售报价";

    /**
     * 进销存-销售订单
     */
    public static final String TYPE_JXC_SALE_ORDER = "jxc_sale_order";
    public static final String TYPE_NAME_JXC_SALE_ORDER = "进销存-销售订单";

    /**
     * 进销存-销售退货单
     */
    public static final String TYPE_JXC_SALE_RETURN_BILL = "jxc_sale_return_bill";
    public static final String TYPE_NAME_JXC_SALE_RETURN_BILL = "进销存-销售退货单";

    /**
     * 进销存-采购订单
     */
    public static final String TYPE_JXC_BUY_ORDER = "jxc_buy_order";
    public static final String TYPE_NAME_JXC_BUY_ORDER = "进销存-采购订单";

    /**
     * 进销存-采购退货单
     */
    public static final String TYPE_JXC_BUY_RETURN_BILL = "jxc_buy_return_bill";
    public static final String TYPE_NAME_JXC_BUY_RETURN_BILL = "进销存-采购退货单";

    /**
     * 进销存-出库单
     */
    public static final String TYPE_JXC_OUT_BILL = "jxc_out_bill";
    public static final String TYPE_NAME_JXC_OUT_BILL = "进销存-出库单";

    /**
     * 进销存-入库单
     */
    public static final String TYPE_JXC_IN_BILL = "jxc_in_bill";
    public static final String TYPE_NAME_JXC_IN_BILL = "进销存-入库单";

    /**
     * 进销存-调拨单
     */
    public static final String TYPE_JXC_STOCK_TRANSFER = "jxc_stock_transfer";
    public static final String TYPE_NAME_JXC_STOCK_TRANSFER = "进销存-调拨单";

    /**
     * 进销存-盘点信息
     */
    public static final String TYPE_JXC_STOCK_INVENTORY = "jxc_stock_inventory";
    public static final String TYPE_NAME_JXC_STOCK_INVENTORY = "进销存-盘点信息";

    /**
     * 进销存-对账单
     */
    public static final String TYPE_JXC_FINANCE_ACCOUNT = "jxc_finance_account";
    public static final String TYPE_NAME_JXC_FINANCE_ACCOUNT = "进销存-对账单";

    /**
     * 进销存-收票申请
     */
    public static final String TYPE_JXC_BUY_INVOICE = "jxc_buy_invoice";
    public static final String TYPE_NAME_JXC_BUY_INVOICE = "进销存-收票申请";

    /**
     * 进销存-开票申请
     */
    public static final String TYPE_JXC_SALE_INVOICE = "jxc_sale_invoice";
    public static final String TYPE_NAME_JXC_SALE_INVOICE = "进销存-开票申请";

    /**
     * 进销存-收付款
     */
    public static final String TYPE_JXC_FINANCE_RECV_PAY_BILL = "jxc_finance_recv_pay_bill";
    public static final String TYPE_NAME_JXC_FINANCE_RECV_PAY_BILL = "进销存-收付款";

    /**
     * 进销存-付款单
     */
    public static final String TYPE_JXC_FINANCE_PAY_BILL = "jxc_finance_pay_bill";
    public static final String TYPE_NAME_JXC_FINANCE_PAY_BILL = "进销存-付款单";

    /**
     * 进销存-销售对账单
     */
    public static final String TYPE_JXC_FIN_RECONCILIATION_SALE = "jxc_fin_reconciliation_sale";
    public static final String TYPE_NAME_JXC_FIN_RECONCILIATION_SALE = "进销存-销售对账单";

    /**
     * 进销存-采购对账单
     */
    public static final String TYPE_JXC_FIN_RECONCILIATION_BUY = "jxc_fin_reconciliation_buy";
    public static final String TYPE_NAME_JXC_FIN_RECONCILIATION_BUY = "进销存-采购对账单";

    /**
     * 进销存-发货记录
     */
    public static final String TYPE_JXC_SEND = "jxc_send";
    public static final String TYPE_NAME_JXC_SEND = "进销存-发货记录";

    /**
     * 进销存-售后记录
     */
    public static final String TYPE_JXC_POST_SALE = "jxc_post_sale";
    public static final String TYPE_NAME_JXC_POST_SALE = "进销存-售后记录";

    /**
     * 雄大-销售对账
     */
    public static final String TYPE_XD_FIN_RECONCILIATION_SALE = "xd_fin_reconciliation_sale";
    public static final String TYPE_NAME_XD_FIN_RECONCILIATION_SALE = "雄大-销售对账";

    /**
     * 雄大-采购对账
     */
    public static final String TYPE_XD_FIN_RECONCILIATION_BUY = "xd_fin_reconciliation_buy";
    public static final String TYPE_NAME_XD_FIN_RECONCILIATION_BUY = "雄大-采购对账";


    private static final Map<String, String> RULE_CODE_NAME_MAP;

    static {
        RULE_CODE_NAME_MAP = new HashMap<>();
        RULE_CODE_NAME_MAP.put(TYPE_JXC_SALE_QUOTATION, TYPE_NAME_JXC_SALE_QUOTATION);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_SALE_ORDER, TYPE_NAME_JXC_SALE_ORDER);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_SALE_RETURN_BILL, TYPE_NAME_JXC_SALE_RETURN_BILL);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_BUY_ORDER, TYPE_NAME_JXC_BUY_ORDER);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_BUY_RETURN_BILL, TYPE_NAME_JXC_BUY_RETURN_BILL);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_OUT_BILL, TYPE_NAME_JXC_OUT_BILL);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_IN_BILL, TYPE_NAME_JXC_IN_BILL);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_STOCK_TRANSFER, TYPE_NAME_JXC_STOCK_TRANSFER);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_STOCK_INVENTORY, TYPE_NAME_JXC_STOCK_INVENTORY);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_FINANCE_ACCOUNT, TYPE_NAME_JXC_FINANCE_ACCOUNT);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_BUY_INVOICE, TYPE_NAME_JXC_BUY_INVOICE);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_SALE_INVOICE, TYPE_NAME_JXC_SALE_INVOICE);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_FINANCE_RECV_PAY_BILL, TYPE_NAME_JXC_FINANCE_RECV_PAY_BILL);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_FIN_RECONCILIATION_SALE, TYPE_NAME_JXC_FIN_RECONCILIATION_SALE);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_FIN_RECONCILIATION_BUY, TYPE_NAME_JXC_FIN_RECONCILIATION_BUY);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_SEND, TYPE_NAME_JXC_SEND);
        RULE_CODE_NAME_MAP.put(TYPE_JXC_POST_SALE, TYPE_NAME_JXC_POST_SALE);
        RULE_CODE_NAME_MAP.put(TYPE_XD_FIN_RECONCILIATION_SALE, TYPE_NAME_XD_FIN_RECONCILIATION_SALE);
        RULE_CODE_NAME_MAP.put(TYPE_XD_FIN_RECONCILIATION_BUY, TYPE_NAME_XD_FIN_RECONCILIATION_BUY);
    }

    public static String getRuleName(String ruleCode) {
        if (!HlpUtils.isEmpty(ruleCode)) {
            return RULE_CODE_NAME_MAP.get(ruleCode);
        }
        return null;
    }
}
